package com.zzy.mccjt.autoconfigure.monitor;

import com.zzy.mccjt.autoconfigure.constants.AppContstants;
import com.zzy.mccjt.autoconfigure.constants.AspectjOrder;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * description----------
 *
 * @author
 * @version 1.0
 * @date 2019/4/18 9:54
 */
@Slf4j
@Aspect
@Order(AspectjOrder.STDIO)
@Component
public  class MonitorAutoConfiguration  {

    @PostConstruct
    void print() {
        log.info("MonitorAutoConfiguration load completed.");
    }

    @Pointcut(AppContstants.POINTCUT_CONTROLLER_EXPRESSION)
    public void anyPublicController() {

    }
    @Pointcut("@within(org.springframework.web.bind.annotation.RestController)||@within(org.springframework.stereotype.Controller)")
    private void anyAnnotationController() {
    }

    @Pointcut("anyPublicController() && anyAnnotationController()")
    private void pointcut() {
    }

}
